import { _decorator, Component, Node, AudioSource, AudioClip, assert } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('AudioMng')
export class AudioMng extends Component {
    
    @property({type:AudioSource})
    audioSource: AudioSource = null;

    @property({type:AudioClip})
    win: AudioClip = null;

    @property({ type: AudioClip })
    defeat: AudioClip = null;
    
    playWin() {
        this.audioSource.volume = 0.3;
        this.audioSource.playOneShot(this.win);
    }

    playDefeat() {
        this.audioSource.volume = 0.3;
        this.audioSource.playOneShot(this.defeat);
    }
}

